<script setup>

import Son1Com from "./components/Son1Com.vue";
import Son2Com from "./components/Son2Com.vue";
import {useCounterStore} from '@/store/counter.js'
import {useChannelStore} from '@/store/channel.js'
import {storeToRefs} from 'pinia'

const counterStore = useCounterStore()
const channelStore = useChannelStore()
console.log(counterStore);

// 直接解构
const { count, msg} = storeToRefs(counterStore)
const {getList} = channelStore


</script>

<template>
  <div>
    <h3>App.vue根组件 - {{count}} - {{msg}}</h3>
    <Son1Com></Son1Com>
    <Son2Com></Son2Com>
    <br>
    <button @click="getList">获取频道数据</button>
    <ul>
      <li v-for="item in channelStore.channelList" :key="item.id">{{item.name}}</li>
    </ul>
  </div>
</template>

<style scoped></style>
